<input type="hidden" id="tid" value="<?= $tid ?>"/>
<input type="hidden" id="planer_tid" value="<?= $planer_tid ?>"/>
<!--主体部分-->
<section class="main">
    <div class="main-inner">
        <div class="bs-cont home">
            <section class="bc-middle clearfix">
                <!--左侧信息-->
                <div class="qb-left plan2 bor fl">
                    <p class="title2 white txt-center">
                        <?php if ($tid == 1): ?>
                            重庆时时彩历史数据
                        <?php elseif ($tid == 2): ?>
                            北京pk10历史数据
                        <?php elseif ($tid == 3): ?>
                            广东11选5历史数据
                        <?php elseif ($tid == 4): ?>
                            江西11选5历史数据
                        <?php elseif ($tid == 5): ?>
                            山东11选5历史数据
                        <?php endif; ?>
                    </p>
                    <ul class="bl-item"> 
                        <li>
                            <span>历史期号</span>
                            <span>开出号码</span>
                        </li>

                    </ul>
                    <div class="kj4">
                        <ul class="bl-item2 opencode_history"></ul>
                    </div>
                </div>
                <!--右侧信息-->
                <div class="qb-right plan bor fl">
                    <div class="br-item br-item0">
                        <!--标题栏-->
                        <div class="title">
                            <?php if ($tid == 1): ?>
                                重庆时时彩后一五码三期人工计划
                            <?php elseif ($tid == 2): ?>
                                北京pk10冠军五码三期人工计划
                            <?php elseif ($tid == 3): ?>
                                广东11选5任选一一码三期人工计划
                            <?php elseif ($tid == 4): ?>
                                江西11选5任选一一码三期人工计划
                            <?php elseif ($tid == 5): ?>
                                山东11选5任选一一码三期人工计划
                            <?php endif; ?>

                        </div>
                        <div class="title-nav2 bor">
                            <?php foreach ($planer as $k => $rows): ?>

                                <span <?php if ($k == $planer_tid): ?>class="cur"<?php endif; ?> planer_tid="<?= $k ?>"><?= $rows ?></span>
                            <?php endforeach; ?>
                        </div>
                        <section class="qb2 dash-bor fs16">
                            <ul class="plancode_history on">
                            </ul>
                        </section>
                        <div class="des">
                            <p class="fs16 lasted_opencode"></p>
                            <p class="fs16"><?=$webinfo['plantail']['value']?></p>
                            <p class="fs16">用键盘Ctrl+D键一起按下把网页保存到桌面</p>
                        </div>
                    </div>

                    <!--网页版说明-->
                    <section>
                        <div class="title">千变计划网页版说明</div>	
                        <div class="list-des">
                            <p>1、您当前访问的页面为千变计划首页（http://www.68892.com）；若不会使用请点击→帮助文档←</p>
                            <p>2、上方为哈哈时时彩人工计划员在当期（20180420-027）所提供的最新人工计划号码，本页面只保留最新期号码 若需要观察每个计划员的计划号码准确率，可直接点击上方计划进入计划员专属计划号码列表。</p>
                            <p>3、请使用键盘Ctrl+D键一起按下，可以将“千变计划”保存在桌面，以后可直接打开查看计划号。</p>
                        </div>
                    </section>

                </div>
            </section>
        </div>
    </div>
</section>

<script type="text/javascript" src="js/jquery.min.js" ></script>
<script>
    // 详情切换
    $(function () {
        let lottery_type_id = $("#tid").val();
        let planer_tid = $("#planer_tid").val();
        getOpencode(lottery_type_id);
        getPlanerPlancode(lottery_type_id, planer_tid);

        $('.title-nav2 span').click(function () {
            $(this).addClass('cur').siblings().removeClass('cur');
            planer_tid = $(this).attr('planer_tid');
            getPlanerPlancode(lottery_type_id, planer_tid);
        });
    });

    function getOpencode(tid) {
        let url = "<?= site_url('plan/getOpencode') ?>";
        let jsonData = {
            'tid': tid
        };
        $.get(url, jsonData, function (redata) {
            let str = '';
            for (x in redata.opencode) {
                str += '<li><span>' + redata.opencode[x].issue + '</span><span>' + redata.opencode[x].opencode + '</span></li>';
            }
            $(".opencode_history").html(str);
        }, 'json');
        setTimeout(getOpencode,30000,tid);
    }
    //获取计划员计划
    function getPlanerPlancode(tid, planer_tid) {
        let url = "<?= site_url('plan/getPlanerPlancode') ?>";
        let jsonData = {
            'tid': tid,
            'planer_tid': planer_tid
        };
        $.get(url, jsonData, function (redata) {
            let str = '';
            for (x in redata.plancode) {
                let result = '';
                if (redata.plancode[x].is_hit == 0 && redata.plancode[x].is_expired == 1) {
                    result = '挂';
                } else if (redata.plancode[x].is_hit == 1) {
                    result = '中' + redata.plancode[x].hit_index;
                } else {
                    let misstiems = parseInt(redata.plancode[x].misstimes) + 1;
                    result = '第' + misstiems + '期正在投注中...';
                }
                str += '<li class="black">' + redata.plancode[x].plan_issue + '<i class="lines"></i>' + redata.planername + '<i class="lines"></i><' + redata.plancode[x].plan_code + '><i class="lines"></i>' + redata.plancode[x].current_issue + '期<i class="lines"></i>' + result + '</li>';
            }
            $(".plancode_history").html(str);
            $(".lasted_opencode").html('当前更新:第'+redata.opencode['issue']+'期，开奖号码【'+redata.opencode['opencode']+'】');
            setTimeout(getPlanerPlancode,30000,tid, planer_tid);
            
        }, 'json');

    }


</script>


</body>
</html>